'''
from tkinter import *

root = Tk()

v = IntVar()#不加括号会有奇怪的现象

Radiobutton(root,text='one',variable=v,value=1).pack(anchor=W)
Radiobutton(root,text='two',variable=v,value=2).pack(anchor=W)
Radiobutton(root,text='three',variable=v,value=3).pack(anchor=W)

mainloop()
'''


'''
from tkinter import *

root = Tk()

LANGS = [
    ('Python',1),
    ('Perl',2),
    ('Ruby',3),
    ('Lua',4)]

v = IntVar()
v.set(1)

for lang,num in LANGS:
    b = Radiobutton(root,text=lang,variable=v,value=num,indicatoron=False)
    #b.pack(anchor=W)
    b.pack(fill=X)

mainloop()
'''

from tkinter import *

root = Tk()

group = LabelFrame(root,text='最好的脚本语言是？',padx=5,pady=5)
group.pack(padx=10,pady=10)

LANGS = [
    ('Python',1),
    ('Perl',2),
    ('Ruby',3),
    ('Lua',4)]

v = IntVar()

for lang,num in LANGS:
    b = Radiobutton(group,text=lang,variable=v,value=num)
    b.pack(anchor=W)

mainloop()
